1. Field of the Invention
The present invention relates to a method for converting tags required for a structured document based on an original sequential list, such as XML (eXtensible Markup Language), in a re-constructable manner, and a method and program for restoring same, and more particularly, to a method for converting the order of a structured document into a structured document of unrestricted order, a method for restoring same, and a program for same.
2. Description of the Related Art
A markup method is used as a description language for data conversion. A markup method is a method whereby a mark (tag) is attached to elements, such as document titles, and document text, indicating what each element represents. A typical example is HTML (HyperText Markup Language) that is used for Web presentations. On the other hand, XML (extensible Markup Language) allows the user freely to set tags to be attached when describing information, and hence it has better generic adaptability.
For example, XML allows the attachment of tags determined independently by the user, such as <product> or <number of items>. Therefore, in XML, provided that the meaning of the tags has been determined, data can be extracted without the meanings of the individual elements described in the document being confused.
In a structured document format represented by XML, the document information is constructed logically by means of a method such as tag management, or the like. Therefore, electronic processing of the document can be performed efficiently. For example, provided that the tag meanings are known, this can be convenient for the reuse of data.
The basic composition of a structured document of this kind is a one-dimensional list of tags in hierarchical order, and it is possible to extract the necessary tag data by sort processing, or the like.
In processing a structured document of this kind, a problem arises in that when processing, such as sorting or editing of the original structured document, has been performed, the original structured document cannot be reconstructed on the basis of the processed structured document.
For example, in a document processing device wherein progressive information is received from a transfer source, such as a mobile terminal, even if the required information is a portion at the end of the structured document, it is only possible to receive the whole required document, by sort processing. However, the original structured document cannot be reconstructed from the received document, and if other information in the structured document is required, then the document must be received again.
Similarly, when editing the original structured document, it is necessary to store the edited structured document, and hence the management of the document history becomes complex and the volume of data stored increases.